#include "TUserService.h"
#include <stdio.h>
#include "mysql.h"

int TUserService_Add(const TUser * const model)
{
	printf("patch:201705241411\n");
	// parameter check
	if (model == NULL)
	{
		return -1;
	}

    // init
	MYSQL * conn = NULL;
	BaseService_Init(&conn);
	MYSQL_STMT * stmt = NULL;
	BaseService_StmtInit(&stmt, conn);

	// add
	TUserDal_Add(conn, stmt, model);

	// commit	
	BaseDal_SaveChanges(conn);	

	// close
	BaseService_StmtClose(stmt);
	BaseService_Close(conn);
	return -1;
}
